import {request} from "@utils/http"
import { hospiatlShow, ProvinceList, ReqGetHospitalListParams, ReqGetHospitalListResponse } from "./model/hospitalListTypes";

export function reqGetHospitalList({page,limit,...args}:ReqGetHospitalListParams){
    return request.get<any,ReqGetHospitalListResponse>(`/admin/hosp/hospital/${page}/${limit}`,{
        //query参数
        params:args
    });
}

/* 
    请求 省份 的 api
*/
export function reqGetProvinceList(){
    return request.get<any,ProvinceList>("/admin/cmn/dict/findByDictCode/province");
}


/* 
    请求 市 的 api
    id  省份id
*/
export function reqGetcityList(id:number){
    return request.get<any,ProvinceList>(`/admin/cmn/dict/findByParentId/${id}`);
}


/* 
    请求 区 的 api
    id  市的id
*/
export function reqGetdistrictList(id:number){
    return request.get<any,ProvinceList>(`/admin/cmn/dict/findByParentId/${id}`);
}


/* 
    请求 医院等级 的 api
    固定值   10000
*/
export function reqGethostypeList(){
    return request.get<any,ProvinceList>(`/admin/cmn/dict/findByParentId/10000`);
}


/* 
    请求 医院详情
    id   string
*/
export function reqGethostypeListContentShow(id:string){
    return request.get<any,hospiatlShow>(`/admin/hosp/hospital/show/${id}`);
}


/* 
    医院上下线  请求 api
*/
export function reqUpdateHospitalStatus(id:string,status:number){
    return request.get<any,null>(`/admin/hosp/hospital/updateStatus/${id}/${status}`);
}
